package stark.app.frame;

import android.content.Intent;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;

import androidx.annotation.NonNull;
import stark.app.MainBaseFragment;
import stark.app.alicloud.AliSDKActivity;
import stark.app.frame.banner.BannerDemoActivity;
import stark.app.frame.baseclassuse.BaseClassUseActivity;
import stark.app.frame.compress.FileCompressActivity;
import stark.app.frame.dialog.DialogDemoActivity;
import stark.app.frame.document.DocumentActivity;
import stark.app.frame.netframe.NetFrameActivity;
import stark.app.frame.player.VideoPlayerActivity;
import stark.app.frame.qrcode.QRCodeActivity;
import stark.app.frame.recyleradapter.AdapterDemoActivity;
import stark.app.frame.rxpermission.PermissionDemoActivity;
import stark.app.webserver.WebServerActivity;

public class FrameFragment extends MainBaseFragment {

    @Override
    public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
        TextItemBean b = mAdapter.getItem(position);
        startActivity(new Intent(mContext, b.getDestCls()));
    }

    @Override
    public void addDefaultData() {
        mAdapter.addData(new TextItemBean("Banner", BannerDemoActivity.class));
        mAdapter.addData(new TextItemBean("多种风格的Dialog", DialogDemoActivity.class));
        mAdapter.addData(new TextItemBean("RecyclerView的Adapter", AdapterDemoActivity.class));
        mAdapter.addData(new TextItemBean("权限库", PermissionDemoActivity.class));
        mAdapter.addData(new TextItemBean("网络请求Retrofit2+OkHttp3+RxJava", NetFrameActivity.class));
        mAdapter.addData(new TextItemBean("二维码生成扫描ZXingLite", QRCodeActivity.class));
        mAdapter.addData(new TextItemBean("文件压缩与解压", FileCompressActivity.class));
        mAdapter.addData(new TextItemBean("视频播放器", VideoPlayerActivity.class));
        mAdapter.addData(new TextItemBean("文档类文件预览编辑等", DocumentActivity.class));
        mAdapter.addData(new TextItemBean("web服务器开启", WebServerActivity.class));
        mAdapter.addData(new TextItemBean("阿里云API接口使用", AliSDKActivity.class));
        mAdapter.addData(new TextItemBean("自定义基类使用", BaseClassUseActivity.class));

    }
}